#pragma once

#include <map>
#include <string>

namespace lyt {
    inline std::map<std::string, std::string> map_ = {
        // C++
        {"C++", R"(#include <iostream>
using namespace std;

int main() {
    int a, b;
    while (cin >> a >> b) {
        cout << a + b << endl;
    }
    return 0;
})"},

        // C
        {"C", R"(#include <stdio.h>

int main() {
    int a, b;
    while (scanf("%d %d", &a, &b) != EOF) {
        printf("%d\n", a + b);
    }
    return 0;
})"},

        // Python3
        {"Python3", R"(while True:
    try:
        a, b = map(int, input().split())
        print(a + b)
    except:
        break)"},

        // Java
        {"Java", R"(import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            System.out.println(a + b);
        }
    }
})"},

        // JavaScript
        {"JavaScript", R"(const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.on('line', (line) => {
    let [a, b] = line.split(' ').map(Number);
    console.log(a + b);
});)"},

        // Go (Golang)
        {"Go", R"(package main

import (
    "fmt"
)

func main() {
    var a, b int
    for {
        _, err := fmt.Scan(&a, &b)
        if err != nil {
            break
        }
        fmt.Println(a + b)
    }
})"},

        // C#
        {"C#", R"(using System;

class Program {
    static void Main() {
        string? line;
        while ((line = Console.ReadLine()) != null) {
            var nums = line.Split();
            int a = int.Parse(nums[0]);
            int b = int.Parse(nums[1]);
            Console.WriteLine(a + b);
        }
    }
})"},

        // Rust
        {"Rust", R"(use std::io::{self, BufRead};

fn main() {
    let stdin = io::stdin();
    for line in stdin.lock().lines() {
        let input = line.unwrap();
        let nums: Vec<i32> = input.split_whitespace()
                                  .filter_map(|s| s.parse().ok())
                                  .collect();
        if nums.len() == 2 {
            println!("{}", nums[0] + nums[1]);
        }
    }
})"},

        // Kotlin
        {"Kotlin", R"(fun main() {
    while (true) {
        val line = readLine() ?: break
        val (a, b) = line.split(" ").map { it.toInt() }
        println(a + b)
    }
})"},

        // PHP
        {"PHP", R"(<?php
while ($line = fgets(STDIN)) {
    list($a, $b) = explode(" ", trim($line));
    echo ($a + $b) . PHP_EOL;
})"},

        // Ruby
        {"Ruby", R"(while line = gets
  a, b = line.split.map(&:to_i)
  puts a + b
end)"}
    };
}
